package homework917;
public class MatchesDemo {
    public static void main(String[] args) {
        /*
        邮箱正则表达式
        [a-zA-Z0-9_]+@[a-zA-Z0-9]+(\.[a-zA-Z]+)+
         */

        String email = "abc@163.com";
        String regex = "[a-zA-Z0-9_]+@[a-zA-Z0-9]+(\\.[a-zA-Z]+)+";
        boolean matches = email.matches(regex);
        if(matches){
            System.out.println("匹配成功");
        }else {

             System.out.println("匹配失败");
        }

    }
}
